<template>
	<view class="money">
		<view class="top">
			<view class="tit">我的资金</view>
			<view class="con">{{userinfo.jine|capitalize}}</view>
		</view>
		<view class="middle">
			<view class="item" @click="tozhong">
				<image src="../../static/images/icon/cong.png"></image>
				<view>充值</view>
			</view>
			<view class="item" @click="totixian">
				<image src="../../static/images/icon/tixian.png"></image>
				<view>提现</view>
			</view>
		</view>
		<view class="list">
			<view class="list-item"  @click="tomingxi">
				<view class="left">
					<image mode="widthFix" src="../../static/images/icon/mingxi.png"></image>
					<text>资金明细</text>
				</view>
				<view class="right">
					<image mode="widthFix"  src="../../static/images/icon/you.png"></image>
				</view>
			</view>
			<view class="list-item" @tap="toshouyi">
				<view class="left">
					<image mode="widthFix" src="../../static/images/icon/shouyi.png"></image>
					<text>收益记录</text>
				</view>
				<view class="right">
					<image mode="widthFix"  src="../../static/images/icon/you.png"></image>
				</view>
			</view>
			<view class="list-item" @click="toczjl">
				<view class="left">
					<image mode="widthFix" src="../../static/images/icon/chongzhi.png"></image>
					<text>充值记录</text>
				</view>
				<view class="right">
					<image mode="widthFix"  src="../../static/images/icon/you.png"></image>
				</view>
			</view>
			<view class="list-item" @click="totxjl">
				<view class="left">
					<image mode="widthFix" src="../../static/images/icon/ti.png"></image>
					<text>提现记录</text>
				</view>
				<view class="right">
					<image mode="widthFix"  src="../../static/images/icon/you.png"></image>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import { mapState } from 'vuex';
	export default {
		data() {
			return {
				
				}
			},
		
		methods: {
			toczjl(){
				uni.navigateTo({
					url:'../usercon/czjilu/index'
				})
			},
			tomingxi(){
				uni.navigateTo({
					url:'../usercon/mingxi/index'
				})
			},
			totxjl(){
				uni.navigateTo({
					url:'../usercon/txjilu/index'
				})
			},
			tozhong(){
				uni.navigateTo({
					url:'../usercon/chongzhi/index'
				})
			},
			totixian(){
				uni.navigateTo({
					url:'../usercon/tixian/index'
				})
			},
			toshouyi(){
				uni.navigateTo({
					url:'../usercon/shouyi/index'
				})
			}
			
		},
			filters: {
			capitalize: function(value) {
				if (value) {
					var chazhi = 0;
					chazhi = parseFloat(value).toFixed(2);
					return chazhi;
				} else {
					return 0.00;
				}
		
			}
		},
		onLoad() {
			var data = {
				token: uni.getStorageSync('token')
			}
			this.$store
				.dispatch('cardlist', data)
		},
		computed: mapState({
			 userinfo: 'userinfo'
		})
	}
</script>

<style lang="scss" scoped src="./index.scss"></style>
